# -*- coding: UTF-8 -*-
import cgi
import os
from datetime import datetime
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.api import images
from google.appengine.api import mail
from google.appengine.ext.webapp.util import login_required
from configuration import web_configuration
from configuration import web_home
from modules.ds.dsBase import *
from modules.ds.dsCustom import *
#from modules.mail import maillib

class MainPage(webapp.RequestHandler):
  def get(self):
#===============================================================================
#    PersonDS = dsEntitySet(primary_key = 'PersonalData')
#    PersonDS.PutAll()
#    IntroDS = dsEntitySet(primary_key = 'IntroData')
#    IntroDS.PutAll()
#    PersonalDS = dsEntitySet(primary_key = 'PersonalInfomation')
#    PersonalDS.Append(PersonDS)
#    PersonalDS.Append(IntroDS)
#    PersonalDS.PutAll()
#===============================================================================
    self.response.headers['Content-Type'] = 'text/html'
    

    template_values = {
                       'sWebTitle': web_configuration.Web_Title,
                       'lMainMenu': web_configuration.Main_Menu,
                       'sCopyRight': web_configuration.Web_Copyright,
                       'sHomeTitle': web_home.Home_Title,
                       'sHomeContent': web_home.Home_Content,
     }
    path = os.path.join(os.path.dirname(__file__), "template/index.html")
    self.response.out.write(template.render(path, template_values))

application = webapp.WSGIApplication([('/', MainPage)],
                                      debug=True)

def main():
  run_wsgi_app(application)
if __name__ == "__main__":
      main()